package com.sise.foodplatform.service.impl;

import com.sise.foodplatform.dao.UserMapper;
import com.sise.foodplatform.pojo.User;
import com.sise.foodplatform.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUserByMessage(String username, String password) {
        return userMapper.getUserByMessage(username,password);
    }

    @Override
    public List<User> getAllUser(String username, int PageStart, int pageSize) {
        return userMapper.getAllUser(username,PageStart,pageSize);
    }

    @Override
    public int getUserCounts(String username) {
        return userMapper.getUserCounts(username);
    }

    @Override
    public int updateState(Integer id, Boolean state) {
        return userMapper.updateState(id,state);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public User getUpdateUser(int id) {
        return userMapper.getUpdateUser(id);
    }

    @Override
    public int editUser(User user) {
        return userMapper.editUser(user);
    }


}
